/**
 * @description 依图抓拍的一些些业务赛
 * @author cx
 * @date 2024.06.24 14:20
 */


package com.cx.controller.yitu;

import com.cx.entity.PushedData;
import com.cx.entity.RestResp;
import com.cx.entity.ZtCustomer;
import com.cx.service.PushedDataService;
import com.cx.service.ZtCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/yitu")
public class YiTuBusinessController {
    @Autowired
    private PushedDataService pushedDataService;
    @Autowired
    private ZtCustomerService ztCustomerService;

    @PostMapping("/faceList")
    public RestResp list(@RequestBody PushedData pushedData) {
        pushedData.setCurrentPage(1);
        pushedData.setPageSize(10);
        List<PushedData> part = pushedDataService.getPart(pushedData);
        part.stream().forEach(s -> {
//       四舍五入，保留两位小数
            s.setFaceQuality(String.format("%.2f", Double.parseDouble(s.getFaceQuality())));
        });
        return RestResp.success(part);
    }




    public static void main(String[] args) {


        String format = String.format("%.2f", 2.283);
        System.out.println(format);

    }

}
